/*
这是项目所有公用基础方法
author liuyang
*/

const commonMethods = {
  /**
   * 时间戳转yyyy-mm-dd
   * params --> 时间戳
   */
  timeStampChange(obj) {
    const date =  new Date(obj);
    const y = 1900+date.getYear();
    const m = "0"+(date.getMonth()+1);
    const d = "0"+date.getDate();
    return y+"-"+m.substring(m.length-2,m.length)+"-"+d.substring(d.length-2,d.length);
  },

  /**
   * 获取鼠标当前位置
  */
  getMousePos(e) {
    $('#app').mousemove(function(e){
      // $("span").text(e.pageX + ", " + e.pageY);
      // console.log(e.pageX, e.pageY)
    });
  }
}

module.exports = commonMethods
